package com.hziee.cosmanage.manageandhr.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.hziee.cosmanage.manageandhr.entity.EvaluataeEntity;
import com.hziee.cosmanage.manageandhr.entity.ViolationEntity;
import com.hziee.cosmanage.manageandhr.vo.EvaluataeVo;
import com.hziee.cosmanage.manageandhr.vo.ViolationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.hziee.cosmanage.manageandhr.entity.UserEntity;
import com.hziee.cosmanage.manageandhr.service.UserService;
import com.hziee.common.utils.PageUtils;
import com.hziee.common.utils.R;



/**
 * 
 *
 * @author yb
 * @email yangbin@gmail.com
 * @date 2021-02-10 12:56:11
 */
@RestController
@RequestMapping("manageandhr/user")
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * 部门经理定期评价员工
     * @return
     */
    @PostMapping("/memberEvaluate")
    public R memberEvaluate(@RequestBody EvaluataeVo evaluataeEntity){
        userService.memberEvaluate(evaluataeEntity);
        return R.ok();
    }

    /**
     * 部门经理违规记录员工
     * @param violationEntity
     * @return
     */
    @PostMapping("/memberViolation")
    public R memberViolation(@RequestBody ViolationVo violationEntity){
        userService.memberViolation(violationEntity);
        return R.ok();
    }

//    /**
//     * 列表
//     */
//    @RequestMapping("/list")
//    //@RequiresPermissions("manageandhr:user:list")
//    public R list(@RequestParam Map<String, Object> params){
//        PageUtils page = userService.queryPage(params);
//
//        return R.ok().put("page", page);
//    }
//
//
//    /**
//     * 信息
//     */
//    @RequestMapping("/info/{userId}")
//    //@RequiresPermissions("manageandhr:user:info")
//    public R info(@PathVariable("userId") Integer userId){
//		UserEntity user = userService.getById(userId);
//
//        return R.ok().put("user", user);
//    }
//
//    /**
//     * 保存
//     */
//    @RequestMapping("/save")
//    //@RequiresPermissions("manageandhr:user:save")
//    public R save(@RequestBody UserEntity user){
//		userService.save(user);
//
//        return R.ok();
//    }
//
//    /**
//     * 修改
//     */
//    @RequestMapping("/update")
//   // @RequiresPermissions("manageandhr:user:update")
//    public R update(@RequestBody UserEntity user){
//		userService.updateById(user);
//
//        return R.ok();
//    }
//
//    /**
//     * 删除
//     */
//    @RequestMapping("/delete")
//    //@RequiresPermissions("manageandhr:user:delete")
//    public R delete(@RequestBody Integer[] userIds){
//		userService.removeByIds(Arrays.asList(userIds));
//
//        return R.ok();
//    }

}
